\(\int \frac {\cot (c+d x) \csc (c+d x)}{a+b \sin (c+d x)} \, dx\) [1283]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 25, antiderivative size = 50 \[ \int \frac {\cot (c+d x) \csc (c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {\csc (c+d x)}{a d}-\frac {b \log (\sin (c+d x))}{a^2 d}+\frac {b \log (a+b \sin (c+d x))}{a^2 d} \]

[Out]

-csc(d*x+c)/a/d-b*ln(sin(d*x+c))/a^2/d+b*ln(a+b*sin(d*x+c))/a^2/d

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.120, Rules used = {2912, 12, 46} \[ \int \frac {\cot (c+d x) \csc (c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {b \log (\sin (c+d x))}{a^2 d}+\frac {b \log (a+b \sin (c+d x))}{a^2 d}-\frac {\csc (c+d x)}{a d} \]

[In]

Int[(Cot[c + d*x]*Csc[c + d*x])/(a + b*Sin[c + d*x]),x]

[Out]

-(Csc[c + d*x]/(a*d)) - (b*Log[Sin[c + d*x]])/(a^2*d) + (b*Log[a + b*Sin[c + d*x]])/(a^2*d)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

Rule 2912

Int[cos[(e_.) + (f_.)*(x_)]*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)
])^(n_.), x_Symbol] :> Dist[1/(b*f), Subst[Int[(a + x)^m*(c + (d/b)*x)^n, x], x, b*Sin[e + f*x]], x] /; FreeQ[
{a, b, c, d, e, f, m, n}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {b^2}{x^2 (a+x)} \, dx,x,b \sin (c+d x)\right )}{b d} \\ & = \frac {b \text {Subst}\left (\int \frac {1}{x^2 (a+x)} \, dx,x,b \sin (c+d x)\right )}{d} \\ & = \frac {b \text {Subst}\left (\int \left (\frac {1}{a x^2}-\frac {1}{a^2 x}+\frac {1}{a^2 (a+x)}\right ) \, dx,x,b \sin (c+d x)\right )}{d} \\ & = -\frac {\csc (c+d x)}{a d}-\frac {b \log (\sin (c+d x))}{a^2 d}+\frac {b \log (a+b \sin (c+d x))}{a^2 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.00 \[ \int \frac {\cot (c+d x) \csc (c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {\csc (c+d x)}{a d}-\frac {b \log (\sin (c+d x))}{a^2 d}+\frac {b \log (a+b \sin (c+d x))}{a^2 d} \]

[In]

Integrate[(Cot[c + d*x]*Csc[c + d*x])/(a + b*Sin[c + d*x]),x]

[Out]

-(Csc[c + d*x]/(a*d)) - (b*Log[Sin[c + d*x]])/(a^2*d) + (b*Log[a + b*Sin[c + d*x]])/(a^2*d)

Maple [A] (verified)

Time = 0.26 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.70

method result size
derivativedivides \(-\frac {\csc \left (d x +c \right )}{a d}+\frac {b \ln \left (a \csc \left (d x +c \right )+b \right )}{d \,a^{2}}\) \(35\)
default \(-\frac {\csc \left (d x +c \right )}{a d}+\frac {b \ln \left (a \csc \left (d x +c \right )+b \right )}{d \,a^{2}}\) \(35\)
parallelrisch \(\frac {2 \ln \left (2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+a \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right ) b -2 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b -a \sec \left (\frac {d x}{2}+\frac {c}{2}\right ) \csc \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a^{2} d}\) \(74\)
risch \(-\frac {2 i {\mathrm e}^{i \left (d x +c \right )}}{d a \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}-\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{a^{2} d}+\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{b}\right )}{a^{2} d}\) \(90\)
norman \(\frac {-\frac {1}{2 a d}-\frac {\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d a}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+\frac {b \ln \left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a +2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+a \right )}{a^{2} d}-\frac {b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{2} d}\) \(97\)

[In]

int(cos(d*x+c)*csc(d*x+c)^2/(a+b*sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

-csc(d*x+c)/a/d+1/d/a^2*b*ln(a*csc(d*x+c)+b)

Fricas [A] (verification not implemented)

none

Time = 0.34 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.12 \[ \int \frac {\cot (c+d x) \csc (c+d x)}{a+b \sin (c+d x)} \, dx=\frac {b \log \left (b \sin \left (d x + c\right ) + a\right ) \sin \left (d x + c\right ) - b \log \left (\frac {1}{2} \, \sin \left (d x + c\right )\right ) \sin \left (d x + c\right ) - a}{a^{2} d \sin \left (d x + c\right )} \]

[In]

integrate(cos(d*x+c)*csc(d*x+c)^2/(a+b*sin(d*x+c)),x, algorithm="fricas")

[Out]

(b*log(b*sin(d*x + c) + a)*sin(d*x + c) - b*log(1/2*sin(d*x + c))*sin(d*x + c) - a)/(a^2*d*sin(d*x + c))

Sympy [F]

\[ \int \frac {\cot (c+d x) \csc (c+d x)}{a+b \sin (c+d x)} \, dx=\int \frac {\cos {\left (c + d x \right )} \csc ^{2}{\left (c + d x \right )}}{a + b \sin {\left (c + d x \right )}}\, dx \]

[In]

integrate(cos(d*x+c)*csc(d*x+c)**2/(a+b*sin(d*x+c)),x)

[Out]

Integral(cos(c + d*x)*csc(c + d*x)**2/(a + b*sin(c + d*x)), x)

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.94 \[ \int \frac {\cot (c+d x) \csc (c+d x)}{a+b \sin (c+d x)} \, dx=\frac {\frac {b \log \left (b \sin \left (d x + c\right ) + a\right )}{a^{2}} - \frac {b \log \left (\sin \left (d x + c\right )\right )}{a^{2}} - \frac {1}{a \sin \left (d x + c\right )}}{d} \]

[In]

integrate(cos(d*x+c)*csc(d*x+c)^2/(a+b*sin(d*x+c)),x, algorithm="maxima")

[Out]

(b*log(b*sin(d*x + c) + a)/a^2 - b*log(sin(d*x + c))/a^2 - 1/(a*sin(d*x + c)))/d

Giac [A] (verification not implemented)

none

Time = 0.36 (sec) , antiderivative size = 49, normalized size of antiderivative = 0.98 \[ \int \frac {\cot (c+d x) \csc (c+d x)}{a+b \sin (c+d x)} \, dx=\frac {\frac {b \log \left ({\left | b \sin \left (d x + c\right ) + a \right |}\right )}{a^{2}} - \frac {b \log \left ({\left | \sin \left (d x + c\right ) \right |}\right )}{a^{2}} - \frac {1}{a \sin \left (d x + c\right )}}{d} \]

[In]

integrate(cos(d*x+c)*csc(d*x+c)^2/(a+b*sin(d*x+c)),x, algorithm="giac")

[Out]

(b*log(abs(b*sin(d*x + c) + a))/a^2 - b*log(abs(sin(d*x + c)))/a^2 - 1/(a*sin(d*x + c)))/d

Mupad [B] (verification not implemented)

Time = 12.12 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.78 \[ \int \frac {\cot (c+d x) \csc (c+d x)}{a+b \sin (c+d x)} \, dx=\frac {b\,\ln \left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )}{a^2\,d}-\frac {b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a^2\,d}-\frac {\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2}+\frac {1}{2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}}{a\,d} \]

[In]

int(cos(c + d*x)/(sin(c + d*x)^2*(a + b*sin(c + d*x))),x)

[Out]

(b*log(a + 2*b*tan(c/2 + (d*x)/2) + a*tan(c/2 + (d*x)/2)^2))/(a^2*d) - (b*log(tan(c/2 + (d*x)/2)))/(a^2*d) - (
tan(c/2 + (d*x)/2)/2 + 1/(2*tan(c/2 + (d*x)/2)))/(a*d)